import SimpleXMLRPCServer
import ConfigParser

class deamon:
   def getVersion(self):
       return "first version"

   def addService(self,serviceIp,servicePort):
       pass

class dsysd:
    def __init__(self):
       self.server = SimpleXMLRPCServer.SimpleXMLRPCServer(("localhost",2173))
       self.server.register_instance(deamon())


    def run(self):
       self.server.serve_forever();

class conf:
    def __init__(self):
       config = ConfigParser.ConfigParser()
       config.read("dsysd.conf")
       self.options = config.options("info")
       services = config.get("info","Services").split()
       self.services = [];
       for service in services:
           self.services.push(service.split(':'));
       print self.services

d = conf();
d = dsysd();
d.run();

